﻿using System.Security.Principal;
using Newtonsoft.Json;
using Pyramid.Models;

namespace Pyramid.Security
{
	public interface ICustomPrincipal : IPrincipal
	{
		string UserId { get; set; }
		string FullName { get; set; }
		UserTypes UserType { get; set; }
		int ExtInfoId { get; set; }
		string ExtInfoName { get; set; }
	}

	public class CustomPrincipal : ICustomPrincipal
	{
		public bool IsInRole(string role)
		{
			return false;
		}

		[JsonIgnore]
		public IIdentity Identity { get; set; }

		public string UserId { get; set; }
		public string FullName { get; set; }
		public UserTypes UserType { get; set; }
		public int ExtInfoId { get; set; }
		public string ExtInfoName { get; set; }
	}
}